package com.ty.controller;

import cn.hutool.json.JSONArray;
import com.ty.dto.FileInfo;
import com.ty.dto.UploadInfo;
import com.ty.service.EnumService;
import com.ty.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController  //Handler
@RequestMapping("/api/upload")
public class UploadController {


    @Autowired
    private UploadService uploadService;

    @PostMapping
    public String upload(@RequestBody UploadInfo uploadInfo) {

        return    uploadService.upload(uploadInfo);
    }
    @GetMapping
    public List<FileInfo> select(Integer code) {

        return    uploadService.select(code);
    }

}
